<%@ page language="java" pageEncoding="utf-8"%>

<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-template" prefix="template" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-nested" prefix="nested" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html locale="true">
<script type="text/javascript" src="tree/Bs_Tree.class.js"></script>
<script type="text/javascript" src="tree/Bs_TreeElement.class.js"></script>
<script type="text/javascript" src="tree/Bs_Array.class.js"></script>
  <head>
    <html:base />
    
    <title>CGProject</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
 <script language="javascript">
 var a = new Array;
 var root = '<bean:write name="Tree" property="nodeName"/>';
 	a[0] = new Array;
 	a[0]['caption']          = '<bean:write name="Tree" property="nodeName"/>';
 	a[0]['target']           = "panel";
	a[0]['events']			 = new Array;
	a[0]['events']['onClickCaption'] =	"toMaterialgroup('<bean:write name="Tree" property="nodeLink"/>');";
	var i = -1;
 </script>
 	<logic:iterate id="element" name="Tree" property="childs"><!--1-->
 	<script language="javascript">
		i++;
		
		if(i==0)
		{
			a[0]['children']      = new Array;
		}
		a[0]['children'][i]         = new Array;
		a[0]['children'][i]['caption']  ='<bean:write name="element" property="nodeName"/> ';
		a[0]['children'][i]['events'] = new Array;				
		a[0]['children'][i]['events']['onClickCaption'] = "toMaterialgroup('<bean:write name="element" property="nodeLink"/>');";
		</script>
		<logic:notEmpty name="element" property="childs">
				<script language="javascript">
				var j=-1;
				</script>
			<logic:iterate id="element1" name="element" property="childs"><!--2-->
			<script language="javascript">
			j++;
			if(j==0)
			{
				a[0]['children'][i]['children']      = new Array;
			}
			a[0]['children'][i]['children'][j]      = new Array;
			a[0]['children'][i]['children'][j]['caption']  ='<bean:write name="element1" property="nodeName"/>';
			a[0]['children'][i]['children'][j]['events'] = new Array;
			a[0]['children'][i]['children'][j]['events']['onClickCaption'] = "toMaterialgroup('<bean:write name="element1" property="nodeLink"/>');";
			</script>
			<logic:notEmpty name="element1" property="childs">
			<script language="javascript">
			var k=-1;
			</script>
			<logic:iterate id="element2" name="element1" property="childs"><!--3-->
				<script language="javascript">
				k++;
				if(k==0)
				{
					a[0]['children'][i]['children'][j]['children']         = new Array;
				}
				a[0]['children'][i]['children'][j]['children'][k]      = new Array;
				a[0]['children'][i]['children'][j]['children'][k]['caption']  ='<bean:write name="element2" property="nodeName"/>';
				a[0]['children'][i]['children'][j]['children'][k]['events'] = new Array;
				a[0]['children'][i]['children'][j]['children'][k]['events']['onClickCaption'] = "toMaterialgroup('<bean:write name="element2" property="nodeLink"/>');";
				</script>
				<logic:notEmpty name="element2" property="childs">
				<script language="javascript">
				var l = -1;
				</script>
				<logic:iterate id="element3" name="element2" property="childs"><!-- 4 -->
					<script language="javascript">
					l++;
					if(l==0)
					{
						a[0]['children'][i]['children'][j]['children'][k]['children']         = new Array;
					}
					a[0]['children'][i]['children'][j]['children'][k]['children'][l]      = new Array;
					a[0]['children'][i]['children'][j]['children'][k]['children'][l]['caption']  ='<bean:write name="element3" property="nodeName"/>';
					a[0]['children'][i]['children'][j]['children'][k]['children'][l]['events'] = new Array;				
					a[0]['children'][i]['children'][j]['children'][k]['children'][l]['events']['onClickCaption'] = "toMaterialgroup('<bean:write name="element3" property="nodeLink"/>');";
					</script>
					<logic:notEmpty name="element3" property="childs">
					<script language="javascript">
					var m=-1;
					</script>
					<logic:iterate id="element4" name="element3" property="childs"><!-- 5 -->
					<script language="javascript">
						m++;

						if(m==0)
						{
							a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children']     = new Array;
						}
						a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]      = new Array;
						a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['caption']  ='<bean:write name="element4" property="nodeName"/>';
						a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['events'] = new Array;				
						a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['events']['onClickCaption'] = "toMaterialgroup('<bean:write name="element4" property="nodeLink"/>');";
					</script>
					</logic:iterate><!-- 5 -->
					</logic:notEmpty>
				</logic:iterate><!-- 4 -->
				</logic:notEmpty>
			</logic:iterate><!--3-->
			</logic:notEmpty>
			</logic:iterate><!--2-->
		</logic:notEmpty>
 	</logic:iterate><!--1-->
<script language="javascript">
  var tree = new Bs_Tree();
function init() {
  //tree = new Bs_Tree();
  tree.lookAhead = 2;
  tree.imageDir = 'win98/';
  tree.initByArray(a);
  tree.drawInto('treeDiv1');

  
} 	


function toMaterialgroup(value)
{
	if(navigator.appName=="Microsoft Internet Explorer")
	{
		top.B.location.href="frame.do?Frame=12&Id=16&"+value;
		top.D.location.href="frame.do?Frame=13&Id=19&"+value;
	}
	else
	{
		value = value.replace(/&amp\;/g,"&");
		top.B.location.href="../frame.do?Frame=12&Id=16&"+value;
		top.D.location.href="../frame.do?Frame=13&Id=19&"+value;
		
	}
}


</script>
 	
  <body onLoad="init();">
    <table border="0" width="100%" >
	<tr>
		<td id="treeDiv1">
		</td>
	</tr>
	</table>
  </body>
</html:html>
